package com.qdaily.ui.net.model;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

/**
 * "feeds": {
 * "list": [
 * {},
 * {},
 * {},
 * {},
 * {},
 * {},
 * {},
 * {}
 * ],
 * "last_time": 1409792045,
 * "has_more": true
 * }
 * <p/>
 * Created with IntelliJ IDEA.
 * User: Felix
 * Date: 3/30/15
 * Time: 15:44
 * QQ:74104
 * Email:lovejiuwei@gmail.com
 */
public class ArticleFeeds implements Parcelable {
    private List<ArticleMeta> list = new ArrayList<ArticleMeta>();
    private int last_time = 0;
    private boolean has_more = false;

    public List<ArticleMeta> getList() {
        return list;
    }

    public void setList(List<ArticleMeta> list) {
        this.list = list;
    }

    public int getLast_time() {
        return last_time;
    }

    public void setLast_time(int last_time) {
        this.last_time = last_time;
    }

    public boolean isHas_more() {
        return has_more;
    }

    public void setHas_more(boolean has_more) {
        this.has_more = has_more;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeTypedList( list );
        dest.writeInt( this.last_time );
        dest.writeByte( has_more ? (byte) 1 : (byte) 0 );
    }

    public ArticleFeeds() {
    }

    private ArticleFeeds(Parcel in) {
        in.readTypedList( list, ArticleMeta.CREATOR );
        this.last_time = in.readInt();
        this.has_more = in.readByte() != 0;
    }

    public static final Parcelable.Creator<ArticleFeeds> CREATOR = new Parcelable.Creator<ArticleFeeds>() {
        public ArticleFeeds createFromParcel(Parcel source) {
            return new ArticleFeeds( source );
        }

        public ArticleFeeds[] newArray(int size) {
            return new ArticleFeeds[ size ];
        }
    };
}
